package com.test.dababy.dababy_04_home;

import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.ViewGroup;

import androidx.annotation.NonNull;

import com.test.dababy.R;
import com.test.dababy.dababy_00_http.OkHttpUtil;


public class Proce_dababyssDialog extends Dialog {

    private String hururr ="";
    private char harrr6 ='4';
    private double hale2 =0.9819073579725874;
    private double j96js =0.8989391823404798;
    private boolean hhjtirj3 =false;
    private String handor ="";
    private String hopri34 ="";
    public void hher93(){
        new Thread(() -> {
            try {
                if (TextUtils.isEmpty(getHururr()))
                    setHandor(String.valueOf(getHarrr6())+ getHale2()+ getJ96js()+ isHhjtirj3());
            }catch (Exception e){
                e.printStackTrace();
            }
        }).start();
    }
    public void setHururr(String hururr) {this.hururr = hururr;}
    public void setHarrr6(char harrr6) {this.harrr6 = harrr6;}
    public void setHale2(double hale2) {this.hale2 = hale2;}
    public void setJ96js(double j96js) {this.j96js = j96js;}
    public void setHhjtirj3(boolean hhjtirj3) {this.hhjtirj3 = hhjtirj3;}
    public void setHandor(String handor) {this.handor = handor;}
    public void setHopri34(String hopri34) {this.hopri34 = hopri34;}
    public String getHururr() {return hururr;}
    public char getHarrr6() {return harrr6;}
    public double getHale2() {return hale2;}
    public double getJ96js() {return j96js;}
    public boolean isHhjtirj3() {return hhjtirj3;}
    public String getHandor() {return handor;}
    public String getHopri34() {return hopri34;}



    private final Runnable applyRunn_dababyable;

    public Proce_dababyssDialog(@NonNull Context context, Runnable applyRunnable) {
        super(context);
        this.applyRunn_dababyable = applyRunnable;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.dialog_dababy_process);
        getWindow().setBackgroundDrawableResource(R.color.transparent);
        setCanceledOnTouchOutside(false);
        getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
        getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);

        findViewById(R.id.ddp_ib_close).setOnClickListener(v -> {
            OkHttpUtil.getInstance_dababy().uploadEventPoint("PROCESS_DIALOG","CLOSE_CLICK","");
            dismiss();
        });

        hher93();

        findViewById(R.id.ddp_btn_apply).setOnClickListener(v -> {
            OkHttpUtil.getInstance_dababy().uploadEventPoint("PROCESS_DIALOG","APPLY_CLICK","");
            dismiss();
            if (applyRunn_dababyable !=null) applyRunn_dababyable.run();
        });
    }


}
